/**
 * 
 */
package com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.money;

import com.alstudio.module.xmpp.protocol.xmpp.packact.ALXmppDomainConfig;
import com.alstudio.module.xmpp.protocol.xmpp.packact.IQNameSpace;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.AlXmlTag;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate;

/**
 * @author alonso lee
 *
 */
public class GetUserPointsHitoryIQCreator extends BaseIQTemplate {

	/**
	 * 
	 */
	public GetUserPointsHitoryIQCreator(String start,String end,String domain) {
		// TODO Auto-generated constructor stub
		this.start = start;
		this.end = end;
		this.domain = domain;

	}
	
	/* (non-Javadoc)
	 * @see com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate#getIQXml()
	 */
	@Override
	public String getIQXml() {
		// TODO Auto-generated method stub
		to = ALXmppDomainConfig.getALXmppDomainConfig().getDomainByNameSpace(
				IQNameSpace.NS_GET_POINT_HISTORY);
		mALIQCreator.setTo(to + domain);
		mALIQCreator.setNs(IQNameSpace.NS_GET_POINT_HISTORY);
		mALIQCreator.setType(IQ_TYPE_GET);
		
		AlXmlTag indexTag = new AlXmlTag("index");
		indexTag.setAtt("start", start);
		indexTag.setAtt("end", end);
		tagList.add(indexTag);
		mALIQCreator.setTagList(tagList);

		String xml = "";
		try {
			xml = mALIQCreator.getXml();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return xml;
	}

}
